import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import qiankun from 'vite-plugin-qiankun';
import path from 'path'

import { name } from './package.json';

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    react(),
    qiankun(name, {
      useDevMode: true
    })
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
    extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] // 确保包含.vue
  },
  server: {
    open: true,
    port: 4001,
    headers: {
      'access-control-allow-origin': '*'
    }
  }
})
